package com.blog.backend.gateWayController;


import com.blog.backend.req.PageAlbumReq;
import com.blog.backend.resp.BlogAlbumResp;
import com.blog.backend.service.BlogAlbumService;
import com.blog.backend.utils.Result;
import com.blog.backend.vo.PageResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/doorAlbum")
public class DoorAlbumController {

    @Resource
    private BlogAlbumService blogAlbumService;

    @PostMapping("/getAlbumList")
    @ApiOperation("相册列表")
    public Result<PageResult<BlogAlbumResp>> getAlbumList(@RequestBody PageAlbumReq req){
        PageResult<BlogAlbumResp> result=  blogAlbumService.getAlbumList(req);
        return Result.success(result);
    }

    @GetMapping("/getDoorAlbumDetail")
    public Result<BlogAlbumResp> getDoorAlbumDetail(@RequestParam String albumId){
        BlogAlbumResp resp = blogAlbumService.selectAlbumDetail(albumId);
        return Result.success(resp);
    }
}
